<?php
/**
 * Created by PhpStorm.
 * User: 徐嘉宾
 * Date: 2016/8/9
 * Time: 11:15
 */
$this->registerCssFile('@web/css/backstage.css',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/js/setHeight.js',['depends'=>['app\assets\AppAsset']]);
use yii\helpers\Url;
use yii\widgets\LinkPager;
// var_dump($readinfo);die;
?>
<div class="box">
<div class="main">
    <!--右侧内容-->
    <div class="cont">
        <div class="title">题目概况</div>
        <div class="details">
            <div class="details_operation clearfix">
                <div class="bui_select">
                    <input type="button" value="添&nbsp;&nbsp;加" class="add" onclick="location.href = './?r=admin/readadd';">
                </div>
                <div class="fr">
                    <div class="text">
                        <span>日期：</span>
                        <div class="bui_select">
                            <select name="" id="" class="select">
                                <option value="1"><?= date("Y-m-d "); ?></option>
                            </select>
                        </div>
                    </div>
                    <div class="text">
                        <span></span>
                        <div class="bui_select">
                            <select name="" id="" class="select">
                                <option value="1">Let the cat out of the bag.</option>
                            </select>
                        </div>
                    </div>
                    <div class="text">
                        <span></span>
<!--                        <input type="text" value="" class="search">-->
                    </div>
                </div>
            </div>
            <table class="table" cellspacing="0" cellpadding="0">
                <thead>
                <tr>
                    <th width="15%">属性</th>
                    <th>内容</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>题目</td>
                    <td><?= $readinfo['title']; ?></td>
                </tr>
                <tr>
                    <td>简介</td>
                    <td><?= $readinfo['info']; ?></td>
                </tr>
                <tr>
                    <td>小题数目</td>
                    <td><?= $readinfo['tnum']; ?></td>
                </tr>
                <tr>
                    <td>难度</td>
                    <td><?= $readinfo['diff']; ?></td>
                </tr>
                <tr>
                    <td>一级分类</td>
                    <td><?= $readinfo['class1']; ?></td>
                </tr>
                <tr>
                    <td>二级分类</td>
                    <td><?= $readinfo['class2']; ?></td>
                </tr>
                <tr>
                    <td>图片url</td>
                    <td><?= $readinfo['imgurl']; ?></td>
                <tr>
                    <td>内容</td>
                    <td><?= $readinfo['content']; ?></td>
                </tr>
                 <tr>
                     <td colspan="2" style="text-align: center">
                         <a href="./?r=admin/contentupdate&id=<?= $readinfo['id'] ?>" class="btn">修改文章</a>
                     </td>
                 </tr>       
                <?php if (isset($readinfo['question'])){
                foreach ($readinfo['question'] as $s => $v){ ?>
                    <tr>
                        <td>
                            小题 <?= $v['tnumm'] ?>
                        </td>
                        <td>
                            内容 <?= $v['content'] ?> <br>
                            答案 <?=$v['answer'] ?> <br>
                            题目模板类型 <?= $v['type'] ?> <br>
                            题目段落 <?= $v['paragraph'] ?> <br>
                            题目类型 <?=$v['t_type'] ?> <br>
                    <?php
                    foreach ($v['options'] as $m => $n){
                        $m++;
//                        echo "选项 ".$n['id']."<br>";
                        echo "选项代号 ".$n['option']."<br>";
                        echo "选项内容 " .$n['content']."<br>";
                    }
                    ?>
                    </tr>
                    <tr>
                        <td colspan='2' style='text-align: center'>
                        <a class='btn' href='./?r=admin/readquestionupdate&id=<?= $readinfo['id'] ?>&qid=<?= $v['qid'] ?> '>修改小题</a>
                        <a class='btn' href='./?r=admin/readquestiondelete&id= <?= $readinfo['id'] ?>&qid=<?= $v['qid'] ?>'>删除小题</a>
                        </td>
                    </tr>
                <?php
                }}
                ?>
                <tr>
                    <td colspan="2" style="text-align: center"><a href="./?r=admin/readquestion&id=<?= $readinfo['id'] ?>" class="btn">添加小题</a></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</div>